package booroo.swing;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import java.awt.Rectangle;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class AboutProject extends JDialog {

	private final JPanel contentPanel = new JPanel();

	/**
	 * Launch the application.
	 */
	/*public static void main(String[] args) {
		try {
			AboutProject dialog = new AboutProject();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}*/

	/**
	 * Create the dialog.
	 */
	public AboutProject() {
		setBounds(100, 100, 450, 300);
		setLocationRelativeTo(null);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(new BorderLayout(0, 0));
		{
			JPanel amuro = new JPanel();
			contentPanel.add(amuro, BorderLayout.WEST);
			{
				JLabel logo = new JLabel("");
				logo.setIcon(new ImageIcon("C:\\Users\\PC26\\Desktop\\여신2.png"));
				amuro.add(logo);
			}
		}
		{
			JPanel credit = new JPanel();
			credit.setBounds(new Rectangle(0, 0, 250, 0));
			contentPanel.add(credit, BorderLayout.EAST);
			{
				JLabel lblNewLabel = new JLabel("<html><pre>:: 스윙 프로젝트 v1 ::\r\n\r\nYou're my goddess Amuro Namie!\r\n\r\n참가자 : One and Only\r\n\r\n(c) Copyrights 2014. booroo.\r\nAll rights Reserved.\r\n</pre></html>");
				lblNewLabel.setFont(new Font("나눔고딕코딩", Font.BOLD, 12));
				lblNewLabel.setForeground(Color.BLUE);
				credit.add(lblNewLabel);
			}
		}
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			{
				JButton okBtn = new JButton("확인");
				okBtn.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						// System.exit(0);	// JDialog가 JFrame을 닫음
						dispose(); 	// 현재 컴퍼넌트의 리소스만 제거
					}
				});
				okBtn.setActionCommand("OK");
				buttonPane.add(okBtn);
				getRootPane().setDefaultButton(okBtn);
			}
		}
	}

}
